package models;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.Table;

/**
 * Asocia materia, curso y profesor
 * 
 * @author yeisson, camilo
 * 
 */
@Entity
@Table(name = "matricula")
@IdClass(MatriculaId.class)
public class Matricula extends models.Entity<MatriculaId> {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	@Id
	@Column(name = "id_estudiante")
	private Long idEstudiante;

	@Id
	@Column(name = "id_calendario_academico")
	private Long idCalendarioAcademico;

	@Column(name = "id_curso")
	private Long idCurso;

	public Matricula() {

	}

	@Override
	public MatriculaId getId() {

		return new MatriculaId(getIdEstudiante(), getIdCalendarioAcademico());
	}

	@Override
	public void setId(MatriculaId id) {
		setIdEstudiante(id.getIdEstudiante());
		setIdCalendarioAcademico(id.getIdCalendarioAcademico());
	}

	public Long getIdCurso() {
		return idCurso;
	}

	public void setIdCurso(Long idCurso) {
		this.idCurso = idCurso;
	}

	public Long getIdCalendarioAcademico() {
		return idCalendarioAcademico;
	}

	public void setIdCalendarioAcademico(Long idCalendarioAcademico) {
		this.idCalendarioAcademico = idCalendarioAcademico;
	}

	public Long getIdEstudiante() {
		return idEstudiante;
	}

	public void setIdEstudiante(Long idEstudiante) {
		this.idEstudiante = idEstudiante;
	}

}
